local skel = fk.CreateSkill {
  name = "emo__huaxie",
  tags = {Skill.Limited},
}

Fk:loadTranslationTable{
  ["emo__huaxie"] = "花谢",
  [":emo__huaxie"] = "限定技，当你进入濒死时，你可以弃置所有手牌，将体力恢复至1点，并将手牌摸至4张。",

  ["$emo__huaxie1"] = "花开花落花无悔，缘来缘去缘如水",
}

skel:addEffect(fk.EnterDying, {
  anim_type = "defensive",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and player:usedSkillTimes(skel.name, Player.HistoryGame) == 0
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    player:throwAllCards("h", skel.name)
    if player.dead then return end
    room:recover { num = 1 - player.hp , skillName = skel.name, who = player, recoverBy = player }
    if player.dead then return end
    local x = 4 - player:getHandcardNum()
    if x > 0 then
      player:drawCards(x, skel.name)
    end
  end,
})

return skel
